package com.neo.springcloud.controller;

import com.neo.springcloud.entities.CommonResult;
import com.neo.springcloud.entities.Payment;
import com.neo.springcloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class OrderFeignController {
    
    @Autowired
    private PaymentFeignService paymentFeignService;

    @GetMapping("consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById2(@PathVariable("id") Long id) {
        CommonResult<Payment> result = paymentFeignService.getPaymentById(id);
        log.info("result :{}", result);
        return result;
    }

    @GetMapping("consumer/payment/feign/timeout")
    public String paymentFeignTimeout(){
        return paymentFeignService.paymentFeignTimeout();
    }
}
